<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<div id="indexmian">
	<nav class="navbar navbar-default .navbar-fixed-top" role="navigation">
	
	APP信息管理维护 </nav>
	<form action="appmaintain" method="get">
	<div class="row">
		<div class="col-md-4">
			<label>软件名称<input type="text" name="softwareName" value="${softwareName }"></label>
		</div>
		<input type="hidden" value="appmaintain" name="locationString"/>
		<div class="col-md-4">
			<label>APP状态<select name="appStatus">
					<option value="0">--请选择--</option>
					<c:forEach items="${appStatusList }" var="status">
						<c:if test="${status.valueId==statusValue }">
							<option value="${status.valueId }" selected="selected">${status.valueName}</option>
						</c:if>
						<c:if test="${status.valueId!=statusValue }">
							<option value="${status.valueId }" >${status.valueName}</option>
						</c:if>
					</c:forEach>
			</select></label>
		</div>
		<div class="col-md-4">
			<label>所属平台<select name="appFlatform">
					<option value="0">--请选择--</option>
					<c:forEach items="${appFlatformList }" var="flatform">
						<c:if test="${flatform.valueId==flatformValue }">
							<option value="${flatform.valueId }" selected="selected">${flatform.valueName}</option>
						</c:if>
						<c:if test="${flatform.valueId!=flatformValue }">
							<option value="${flatform.valueId }" >${flatform.valueName}</option>
						</c:if>
					</c:forEach>
			</select></label>
		</div>
	</div>
	<div class="row">
		<div class="col-md-4">
			<label>一级分类 <select name="categoryLevel1" id="categoryLevel1">
					<option value="0">--请选择--</option>
					<c:forEach items="${categoryLevel1List }" var="categoryLevel1">
						<option value="${categoryLevel1.id }">${categoryLevel1.categoryName}</option>
					</c:forEach>
			</select></label>
		</div>
		<div class="col-md-4">
			<label>二级分类 <select id="categoryLevel2" name="categoryLevel2">
					<option value="0">--请选择--</option>
			</select></label>
		</div>
		<div class="col-md-4">
			<label>三级分类 <select id="categoryLevel3" name="categoryLevel3">
					<option value="0">--请选择--</option>
			</select></label>
		</div>
	</div>
	<br />
	<input type="submit" value="查询">
</form>
	<table border="1">
		<tr>
			<th>软件名称</th>
			<th>APK名称</th>
			<th>软件大小（单位：ｍ）</th>
			<th>所属平台</th>
			<th>所属分类（一级分类、二级分类、三级分类）</th>
			<th>状态</th>
			<th>下载次数</th>
			<th>最新版本号</th>
			<th>操作</th>
		</tr>
		<c:forEach var="m" items="${appinfo}">
			<tr>
				<td>${m.softwareName}</td>
				<td>${m.APKName}</td>
				<td>${m.softwareSize}</td>
				<td>${m.flatform.valueName}</td>
				<td>${m.categoryLevel3}</td>
				<td>${m.status.valueName}</td>
				<td>${m.downloads}</td>
				<td>${m.version.versionNo}</td>
				<td><div class="btn-group">
						<button class="btn btn-default btn-lg dropdown-toggle"
							type="button" data-toggle="dropdown">
							点击操作 <span class="caret"></span>
						</button>
						<ul class="dropdown-menu">
						<c:if test="${m.status.valueId==2 or m.status.valueId==5 }"><li><a href="javascript:void(0);" onclick="updateStatus(1,${m.id});">上架</a></li></c:if>
						<c:if test="${m.status.valueId==4 }"><li><a href="javascript:void(0);" onclick="updateStatus(2,${m.id});">下架</a></li></c:if>
						<li><a href="addmaintain?id=${m.getId()}">新增版本</a></li>
						<li><a href="javascript:void(0);" onclick="updateAppVersion(${m.status.valueId },'${m.status.valueName}','${m.version.versionNo }',${m.id});">修改版本</a></li>
						<li><a href="updateApp?id=${m.getId()}">修改</a></li>
						<li><a href="selectAppInfo?id=${m.id }">查询</a></li>
						<li><a href="javascript:void(0);" onclick="deleteAppInfo(this,${m.id});">删除</a></li>
						</ul>
					</div></td>
			</tr>
		</c:forEach>
	</table>
	<div>
		<label>共${rows }条记录 <span>${page }/${pageCount }页</span></label>
		<c:if test="${page > 1 }"><a href="appmaintain?page=1&softwareName=${softwareName }&
			appStatus=${statusValue}&appFlatform=${appFlatformValue}&categoryLevel1=${categoryLevel1}&
			categoryLevel2=${categoryLevel2}&categoryLevel3=${categoryLevel3}">第一页</a>
		</c:if>
		<c:if test="${page > 1 }"><a href="appmaintain?page=${page-1 }&softwareName=${softwareName }&
			appStatus=${statusValue}&appFlatform=${appFlatformValue}&categoryLevel1=${categoryLevel1}&
			categoryLevel2=${categoryLevel2}&categoryLevel3=${categoryLevel3}">上一页</a>
		</c:if>
		<c:if test="${page < pageCount }"><a href="appmaintain?page=${page+1 }&softwareName=${softwareName }&
			appStatus=${statusValue}&appFlatform=${appFlatformValue}&categoryLevel1=${categoryLevel1}&
			categoryLevel2=${categoryLevel2}&categoryLevel3=${categoryLevel3}">下一页</a>
		</c:if>
		<c:if test="${page < pageCount }"><a href="appmaintain?page=${pageCount }&softwareName=${softwareName }&
			appStatus=${statusValue}&appFlatform=${appFlatformValue}&categoryLevel1=${categoryLevel1}&
			categoryLevel2=${categoryLevel2}&categoryLevel3=${categoryLevel3}">最后一页</a>
		</c:if>
		
	</div>
</div>
